Repository navigation
Conversation
e2b3cf7 to
47e03ef
Compare
There was a problem hiding this comment.
Not sure if this interface/generalization is actually needed.
The actual problem is the DeltaByteArrayReader needs to reset the 'previous' member to fix the bug.
It needs the previous char array, the previous value, not the previous reader. This interface gives an impression the subclass could hold a reference of the previous reader.
How about:
remove this interface,
create a setPreviousValue method in DeltaByteArrayReader.
and call:
setPreviousValue(deltaByteArrayReader.previous)
There was a problem hiding this comment.
Previous is internal state. This method avoids exposing that state to others, allowing access to all private members in the recipient ValuesReader.
To avoid parsing with more frequent checks, this adds a hasSemanticVersion and getSemanticVersion methods to the parsed version. Using this API, callers can cache the version object for a given createdBy string and use it in multiple checks.
This adds RequriresPreviousReader, which allows ValuesReader imlementations to use the previous reader for initialization. By delegating to the reader implementation, this doesn't need to add getter and setter methods to DeltaByteArrayReader. This also adds a method to Encoding, requiresSequentialReads(version). This allows the Encoding to determine whether pages can be skipped for a given writer verison. This is used by ColumnReaderImpl to detect when to call RequiresPreviousReader#setPreviousReader. The logic to determine whether the delta byte array bug is present is in CorruptDeltaByteArrays, which is based on CorruptStatistics. This class is part of the public API. The remaining changes pass the created-by string through the read path to the ColumnReaderImpl.
This adds tests for the previous commit's delta byte array fix. It verifies that it reproduces the failure condition and that it can correctly read pages when they are managed by the ColumnReaderImpl.
This adds an option to turn off file splitting because the delta byte array corruption problem spans row groups. The only way to correctly read data is to read the file from beginning to end. This catches the problem in ParquetRecordReader when the file footer is available and throws an exception to stop the job. Catching the problem in ParquetInputFormat#getSplits would prevent jobs from failing, but would dramatically slow down all job submission. This also adds a check in the ColumnReaderImpl that points users at PARQUET-246 when the failure occurs.
bceb5c9 to
4368207
Compare
4368207 to
067d5ca
Compare
|
+1 |
There was a problem hiding this comment.
Hi @rdblue I'm trying to upgrade scalding to parquet 1.8.0 and I'm seeing an java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 here in a test that runs on a local mini-cluster.
Is it a valid assumption that this list always has a 0th element? In the case of task-side filtering, it is possible for a task to discover that there are 0 matching row groups right? I think this is a bug, but I want to make sure I'm not just missing something.
This is another way to recover data written with the delta byte array problem in PARQUET-246. This builds on @isnotinvain's strategy for solving the problem by adding a method to the encoding to detect it. This version is more similar to the fix for PARQUET-251 and includes a CorruptDeltaByteArrays helper class that uses the writer version. Most of the file changes are to get the file writer version to Encoding and the ColumnReaderImpl.
This also repairs the problem by using a new interface, RequiresPreviousReader, to pass the previous ValuesReader, which is slightly cleaner because the reader doesn't need to expose getter and setter methods.
The problem affects pages written to different row groups, so it was necessary to detect the problem in parquet-hadoop and fail jobs that cannot reconstruct data. The work-around to recover is to set "parquet.split.files" to false so that files are read sequentially. This could be set automatically in isSplittable, but this would require reading all file footers before submitting jobs, which was recently fixed. I think it is a fair compromise to detect the error case and recommend a solution.
This also includes tests for the problem to verify the fix.
Replaces old pull requests: closes #217 closes #235